/*
 * @Author: 清羽
 * @Date: 2022-08-18 10:54:47
 * @LastEditTime: 2022-09-07 21:44:35
 * @LastEditors: you name
 * @Description:
 */
import request from '@/utils/request'
import { admin } from '@/utils/base'

// export function getProductList () {
// 	return request({
// 		url: '/admin/product/check/list',
// 		method: 'get'
// 	})
// }

const product = {
	// 获取商品列表
	getProductList (data) {
		// return request.get('/admin/product/list', data)
		return request({
			url: `${admin}/product/list`,
			method: 'post',
			data
		})
	},
	// 获取商品详情
	getProductInfo (productId) {
		console.log("getProductInfo => productId", productId)
		return request({
			url: `${admin}/product/info/${productId}`,
			method: 'get'
		})
	},
	getProductCheckList () { // 获取商品待审核列表
		return request({
			url: `${admin}/product/check/list`,
			method: 'get'
		})
	},
	submitProductCheckSuccess (productId) { // 提交商品审核成功
		console.log("submitProductCheckSuccess => productId", productId)
		return request({
			url: `${admin}/product/check/ok/${productId}`,
			method: 'get'
		})
	},
	submitProductCheckNot (productId, data) { // 提交商品审核失败
		return request({
			url: `${admin}/product/check/no/${productId}`,
			method: 'post',
			data
		})
	},
	downStockProduct (productId, data) { // 商品下架
		return request({
			url: `${admin}/product/downShelf/${productId}`,
			method: "post",
			data
		})
	}
}

export default product
